function EnnemiesAStar() {
    Ennemies.call(this);
		
	this.pos = { x: 0, y: 0 };
    this.size = { x: 12, y: 18 };
	this.realSize = { x: 12, y: 18 };
	this.spriteSize = { x: 32, y: 32 };	
	this.detect = false;
	
	this.update = function(elapsed, keysDown) {
       
		if(!this.isAlive()) {
			return;
		}
		
		var ax = this.getPostionInMapX();
		var ay = this.getPostionInMapY();
		var px = player.getPostionInMapX();
		var py = player.getPostionInMapY();
		
		if(player.isAlive() && levels[currentLevel].isTileVisible(ax, ay, px, py, this.getRadius())){
			var soluce = levels[currentLevel].astar.process(ax, ay, px, py);

			if(soluce.length > 1 && soluce[1].length > 1) {
				var nax = soluce[1][1][0];
				var nay = soluce[1][1][1];
				var dax = ax-nax;
				var day = ay-nay;
				
				this.direction[Keys.Left] = dax>0;
				this.direction[Keys.Right] = dax<0;
				this.direction[Keys.Up] = day>0;
				this.direction[Keys.Down] = day<0;
			}	
			else {
				this.randomDirection();
			}			
		}
		else {
			this.randomDirection();
		}	

		this.updateMovement(elapsed, keysDown);

		if(!this.actionAttack()) {
			this.actionAttackPare(keysDown);
		}
    };
}